import { createApp } from 'vue'
import App from './App.vue'
import router from './router/'
import globalconfig from '../globalConfig'
import { store, key } from './store'
import elementPlus from './plugins/element-plus'

// 改变 SCSS 变量
// import './styles/element-variables.scss'

// 加载全局样式
import './styles/index.scss'

const app = createApp(App)

app.config.globalProperties.config = globalconfig

app.use(router)
app.use(store, key)
app.use(elementPlus)
app.mount('#app')

// 自动注册全局组件
const modules = import.meta.globEager('./components/**/index.ts')
for (const path in modules) {
  app.use(modules[path].default)
}
